#!/bin/bash

echo "Daily Build Results..."
echo "Compiling project..."
$1scripts/buildFirbi.sh $1
echo "Compiling test..."
android update project -n FIRBI_Tests -p $1tests -t 3
ant debug -f $1tests/build.xml
echo "Running test..."
emulator -avd $2 &
adb wait-for-device $2
sleep 30
adb install -r $1bin/FIRBI-debug.apk
adb install -r $1tests/bin/FIRBI_Tests-debug.apk
adb shell am instrument -e class firbi.base.UnitTestRunner -w firbi.base.tests/android.test.InstrumentationTestRunner
sleep 5
adb shell am instrument -e class firbi.base.SearchTestGPSUsage -w firbi.base.tests/android.test.InstrumentationTestRunner
sleep 5
adb shell am instrument -e class firbi.base.SearchTestSearchBar -w firbi.base.tests/android.test.InstrumentationTestRunner
sleep 5
adb shell am instrument -e class firbi.base.RouteViewTest_Functional -w firbi.base.tests/android.test.InstrumentationTestRunner
sleep 5
adb shell am instrument -e class firbi.base.StopView_Functional_Test -w firbi.base.tests/android.test.InstrumentationTestRunner

